package com.liuym.common.dubbo.student.api;

import com.liuym.common.dubbo.student.dto.StudentDTO;
import com.liuym.common.exception.StudentException;

import java.util.List;
import java.util.Map;

/**
 * @author LiuYiMing
 * @date 2018/9/17 16:59
 * @describe：
 */
public interface StudentDubboService {
    /**
     * 通过学号获取学生信息
     *
     * @param studentNumber
     * @return
     * @throws StudentException
     */
    StudentDTO getStudentByNumber(long studentNumber) throws StudentException;

    /**
     * 获取全部学生信息
     *
     * @return
     * @throws StudentException
     */
    List<StudentDTO> getAllStudent() throws StudentException;

    /**
     * 通过班号获取学生信息
     *
     * @param classNumber
     * @return
     * @throws StudentException
     */
    List<StudentDTO> getStudentByClass(long classNumber) throws StudentException;

    /**
     * 添加学生
     *
     * @param studentDTO
     */
    int addStudent(StudentDTO studentDTO) throws StudentException;

    /**
     * 批量添加学生信息
     *
     * @param studentDTOList
     * @return
     * @throws StudentException
     */
    Map<String, Object> addStudentList(List<StudentDTO> studentDTOList) throws StudentException;

    /**
     * 根据学号删除学生
     *
     * @param studentNumber
     * @return
     * @throws StudentException
     */
    int deleteStudentByStudentNumber(long studentNumber) throws StudentException;

    /**
     * 根据学号删除学生
     *
     * @param classNumber
     * @return
     * @throws StudentException
     */
    int deleteStudentByClassNumber(long classNumber) throws StudentException;
    /**
     * 更新学生信息
     *
     * @param studentDTO
     * @return
     * @throws StudentException
     */
    int updateStudent(StudentDTO studentDTO) throws StudentException;

    /**
     * 更新学生分数
     *
     * @param score
     * @param studentNumber
     * @return
     * @throws StudentException
     */
    int updateScoreByStudentNumber(int score, long studentNumber) throws StudentException;

    /**
     * 更新学生分数为80
     *
     * @return
     * @throws StudentException
     */
    int updateStudentScoreTo80() throws StudentException;

    /**
     * 根据班号统计学生数量
     *
     * @param classNumber
     * @return
     */
    Integer getCountByClassNumber(long classNumber);
}
